package Noyau;

import java.util.ArrayList;
import java.util.List;

public class Chariot extends ObjetMobile
{
    private double vitesse;
    private Bagage bagage = null;
    
    public Chariot()
    {
    	
    }

    public double getVitesse ()  {
        return this.vitesse;
    }

    public void setVitesse(double vitesse) {
		this.vitesse = vitesse;
	}

    public Bagage getBagage ()  {
        return this.bagage;
    }
    
    public void setBagage(Bagage bagage)
    {
    	if (bagage != null)
    	{
    		bagage.setParent(this);
    	}
    	
    	this.bagage = bagage;
    }
    
    public void Supprimer()
    {
    	if (this.parent == null)
    	{
    		return;
    	}
    	
    	if (!(this.parent instanceof InterfaceChariot))
    	{
    		return;
    	}
    	
    	InterfaceChariot chariotParent = (InterfaceChariot)this.parent;
    	chariotParent.SupprimerChariot(this);    	
    }
    
    public double getSize()
    {
    	return 1.5;
    }

	@Override
	public int getZBuffer() {
		// TODO Auto-generated method stub
		return 50;
	}
	
	@Override
	public List<ObjetMetier> getChildren()
	{
		List<ObjetMetier> children = new ArrayList<ObjetMetier>();
		
		if (this.bagage != null)
		{
			children.add(this.bagage);
		}
		
		return children;
	}
}
